"""
URL configuration for mysite3 project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from app1.views import empview
from app1.views import loginview
from app1.views import deptview
from app1.views import echartsview
from app1.views import orderview
from app1.views.deptview import download_dept_template
from app2 import views as app2views
from django.views.generic import RedirectView
from django.urls import include
from easyui import views as easyuiviews

urlpatterns = [
    path('', RedirectView.as_view(url='index/'), name='root_redirect'),

    path('admin/', admin.site.urls),

    # 登录相关
    path('login/',loginview.login,name='login'),
    # 這邊的這個推出url是新增的
    path('loginout/',loginview.loginout,name='loginout'),
    # 這邊的這個注冊url是新增的
    path('register/',loginview.reg,name='register'),
    path('getvericodeimg/',loginview.getvericodeimg,name='getvericodeimg'),
    path('index/',loginview.index,name='index'),

    # 员工管理
    path('emp/list/',empview.emp_list,name='emp_list'),
    path('emp/add/',empview.emp_add,name='emp_add'),
    path('emp/update/',empview.emp_update,name='emp_update'),
    path('emp/delete/',empview.emp_delete,name='emp_delete'),


    # 部门管理
    path('dept/list/',deptview.dept_list,name='dept_list'),
    path('dept/add/',deptview.dept_add,name='dept_add'),
    path('dept/update/',deptview.dept_update,name='dept_update'),
    path('dept/delete/',deptview.dept_delete,name='dept_delete'),
    path('dept/batch/add/',deptview.dept_batchadd,name='dept_batchadd'),
    path('dept/template/download/', download_dept_template, name='download_dept_template'),

    # 报表管理
    path('echarts/list/',echartsview.echarts_list,name='echarts_list'),
    path('echarts/chart1/',echartsview.chart1,name='chart1'),
    path('echarts/chart2/',echartsview.chart2,name='chart2'),
    path('echarts/chart3/',echartsview.chart3,name='chart3'),
    path('echarts/chart4/',echartsview.chart4,name='chart4'),

    # 上传文件操作
    path('app2/uploadfile/',app2views.uploadfile),

    # 订单管理
    path('order/list/',orderview.order_list,name='order_list'),
    path('order/add/',orderview.order_add,name='order_add'),
    # 這邊的修改刪除url是新增的
    path('order/update/',orderview.order_update,name='order_update'),
    path('order/delete/',orderview.order_delete,name='order_delete'),

    # easyui应用下面的url
    path('easyui/main/', easyuiviews.index),
    path('easyui/emp/list/',easyuiviews.emp_list,name='easyui.emp_list'),
    path('easyui/emp/add/',easyuiviews.emp_add,name='easyui.emp_add'),
    path('easyui/emp/update/',easyuiviews.emp_update,name='easyui.emp_update'),
    path('easyui/emp/delete/',easyuiviews.emp_delete,name='easyui.emp_delete'),

]
